package com.ruoyi.system.service.impl;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.Random;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import com.ruoyi.system.domain.vo.OrderCommissionVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.GwRightsOrderCommissionMapper;
import com.ruoyi.system.domain.GwRightsOrderCommission;
import com.ruoyi.system.service.IGwRightsOrderCommissionService;

import javax.annotation.Resource;

/**
 * 平台权益佣金Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-05-12
 */
@Service
public class GwRightsOrderCommissionServiceImpl implements IGwRightsOrderCommissionService 
{
    @Resource
    private GwRightsOrderCommissionMapper gwRightsOrderCommissionMapper;

    /**
     * 查询平台权益佣金
     * 
     * @param id 平台权益佣金主键
     * @return 平台权益佣金
     */
    @Override
    public GwRightsOrderCommission selectGwRightsOrderCommissionById(String id)
    {
        return gwRightsOrderCommissionMapper.selectGwRightsOrderCommissionById(id);
    }

    /**
     * 查询平台权益佣金列表
     * 
     * @param gwRightsOrderCommission 平台权益佣金
     * @return 平台权益佣金
     */
    @Override
    public List<GwRightsOrderCommission> selectGwRightsOrderCommissionList(GwRightsOrderCommission gwRightsOrderCommission)
    {
        return gwRightsOrderCommissionMapper.selectGwRightsOrderCommissionList(gwRightsOrderCommission);
    }

    /**
     * 新增平台权益佣金
     * 
     * @param gwRightsOrderCommission 平台权益佣金
     * @return 结果
     */
    @Override
    public int insertGwRightsOrderCommission(GwRightsOrderCommission gwRightsOrderCommission)
    {
        gwRightsOrderCommission.setId(IdUtils.fastSimpleUUID());
        gwRightsOrderCommission.setCreateTime(DateUtils.getNowDate());
        return gwRightsOrderCommissionMapper.insertGwRightsOrderCommission(gwRightsOrderCommission);
    }

    /**
     * 修改平台权益佣金
     * 
     * @param gwRightsOrderCommission 平台权益佣金
     * @return 结果
     */
    @Override
    public int updateGwRightsOrderCommission(GwRightsOrderCommission gwRightsOrderCommission)
    {
        gwRightsOrderCommission.setUpdateTime(DateUtils.getNowDate());
        return gwRightsOrderCommissionMapper.updateGwRightsOrderCommission(gwRightsOrderCommission);
    }

    /**
     * 批量删除平台权益佣金
     * 
     * @param ids 需要删除的平台权益佣金主键
     * @return 结果
     */
    @Override
    public int deleteGwRightsOrderCommissionByIds(String[] ids)
    {
        return gwRightsOrderCommissionMapper.deleteGwRightsOrderCommissionByIds(ids);
    }

    /**
     * 删除平台权益佣金信息
     * 
     * @param id 平台权益佣金主键
     * @return 结果
     */
    @Override
    public int deleteGwRightsOrderCommissionById(String id)
    {
        return gwRightsOrderCommissionMapper.deleteGwRightsOrderCommissionById(id);
    }

    @Override
    public List<OrderCommissionVO> selectList(GwRightsOrderCommission gwRightsOrderCommission) {
        return gwRightsOrderCommissionMapper.selectList(gwRightsOrderCommission);
    }


}
